require("../util.js");
require("../component/components.js");
require("../../jsMt/util.js");
var vm = new Vue({
    el:"#replaceTel",
    data:{
        tel:"",
        mobile:""
    },
    mounted:function(){
        this.searchObject = this.getQueryStringArgs();
        this.tel=this.searchObject&&this.searchObject.tel;
        $("#mobile").focus();
    },
    methods:{
        //后退
        getBack:function(){
            history.go(-1);
        },
        bgimg:function(url){
            url = url?url:"";
            return {
                "background-image":'url("'+url+'"),url("")'
            }
        },
        /*获取查询字符对象*/
        getQueryStringArgs: function () {
            //取得查询字符串并去掉开头的问号
            var qs = (location.search.length > 0 ? location.search.substring(1) : ""),
                args = {},
                items = qs.length ? qs.split("&") : [],
                item = null,
                name = null,
                value = null,
                len = items.length;
            for (var i = 0; i < len; i++) {
                item = items[i].split("=");
                name = item[0];
                value = item[1];
                if (name.length) {
                    args[name] = value;
                }
            }
            return args;
        },
        //跳转
        getNext:function(){
            var that=this;
            if(!that.mobile){
                that.$refs.prompt.toast("手机号不能为空！");
                return false;
            }else{
                if (!/^1[345789]\d{9}$/.test(that.mobile.replace(/^\s+|\s+$/g, ""))) {
                    that.$refs.prompt.toast("请填写正确的手机号码");
                    return false;
                }
            }
            location.href="/telLogin?type=10&tel="+this.tel+"&mobile="+that.mobile;
        }
    },
    watch:{

    }
});